<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>v-on</title>
    <script src="vue.js"></script>
  </head>
  <body>
    <div id="app">
      <input type="button" value="点我一下" v-on:click="test()" />
    </div>
  </body>
  <script>
    new new Vue({
      el: "#app",
      data() {
        return {};
      },
      methods: {
        test: function () {
          alert("你点了我一下");
        },
      },
    })();
  </script>
</html>
